import { createBrowserRouter, Navigate } from "react-router-dom";
import App from "../App";
import Launch from "../view/launch";
import Login from "../view/Login";
import Start from "../view/start";
import Homes from "../view/Homes";
import Searcher from "../view/Searcher";
import Collect from "../view/Collect";
import My from "../view/My";
import Course from "../view/course";
import Home from "../view/Home";
import Register from "../view/Register";
import Upload from "../view/upload";
import Web from '../view/Web'
import Message from "../view/Message";
import Forget from "../view/Forget";
import View from "../view/View";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to="/start" />,

  },
  {
    path: "/",
    element: <Navigate to="/launch" />,
  },
  {
    path: "/app",
    element: <App />,
    children: [
      {
        path: 'home',
        element: <Homes />
      },
      {
        path: "search",
        element: <Searcher />
      },
      {
        path: "collect",
        element: <Collect />
      },
      {
        path: "my",
        element: <My />
      }
    ]
  },
  {
    path: "/launch",
    element: <Launch />,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: '/start',
    element: <Start />
  },
  {
    path: "/course",
    element: <Course />,
  },
  {
    path: "/register",
    element: <Register />,
  },
  {
    path: "/home",
    element: <Home />,
  },
  {
    path: '/upload',
    element: <Upload />
  },
  {
    path: '/web',
    element: <Web />
  },
  {
    path: '/message',
    element: <Message />
  },
  {
    path: '/forget',
    element: <Forget />
  },
  {
    path: '/view',
    element: <View />
  }
]);

export default router;
